package com.workcell.workdata.xthings.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author guoyu
 * @Date 2023/6/6 9:17
 * @Description CommonMapper
 */
@Mapper
public interface CommonMapper extends BaseMapper {

    @DS("dwd_tp")
    @Select("SELECT count(1) FROM dwd_tp_nh where CAST(sum_taee AS UNSIGNED)>2 and use_time=#{time} and hardware_type=#{hardwareType} ")
    Integer nhUnusableDeviceSum( @Param("time") String time, @Param("hardwareType") String hardwareType);

    @DS("dwd_tp")
    @Select("SELECT IF(CAST(input_beisl AS UNSIGNED)<14, 1, 0) as result FROM dwd_tp_qm WHERE id = (SELECT MAX(id) FROM dwd_tp_qm)")
    Integer qmUnusable();
}




